using System;
using System.Runtime.InteropServices;

namespace KodeIT.Web
{
    /// <summary>
    /// This enumeration represents the possible native events that the native ISAPI Filter can register with IIS.
    /// </summary>
    [ComVisible(true)]
    [Flags]
    public enum FilterEvent
    {
        /// <summary>
        /// Represents the event that occurs when data is being read from the client. May occur more than once per request.
        /// </summary>
        ReadRawData = 0x00008000,

        /// <summary>
        /// Represents the event that occurs immediately after IIS has pre-processed headers, but before IIS has begun to process header content.
        /// </summary>
        PreProcHeaders = 0x00004000,

        /// <summary>
        /// Represents the event that occurs just before IIS authenticates the client.
        /// </summary>
        Authentication = 0x00002000,

        /// <summary>
        /// Represents the event that occurs after IIS has translated a URL to a physical path on the server.
        /// </summary>
        UrlMap = 0x00001000,

        /// <summary>
        /// Represents the event that occurs just after IIS has determined that access is denied for the request resource, but before IIS has 
        /// sent a response to the client.
        /// </summary>
        AccessDenied = 0x00000800,

        /// <summary>
        /// Represents the event that occurs after the request has been processed by IIS, but before any headers are sent back to the client.
        /// </summary>
        SendResponse = 0x00000040,

        /// <summary>
        /// Represents the event that occurs as IIS sends raw data back to the client. May occur more than once per request.
        /// </summary>
        SendRawData = 0x00000400,

        /// <summary>
        /// Represents the event that occurs at the end of a request, just before IIS writes the transaction to the IIS log.
        /// </summary>
        Log = 0x00000200,

        /// <summary>
        /// Represents the event that occurs at the end of the request.
        /// </summary>
        EndOfRequest = 0x00000080,

        /// <summary>
        /// Represents the event that occurs when the network session with the client is ending.
        /// </summary>
        EndOfNetSession = 0x00000100,

        /// <summary>
        /// Represents the event that occurs after IIS has successfully completed authentication.
        /// </summary>
        AuthComplete = 0x04000000
    }
}
